/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  Navigator,
  View
} from 'react-native';
import CockpitGet from './js/cockpit.get.js';
let cockpitGet = new CockpitGet();
global.cockpitGet = cockpitGet;

import Login from './js/login.js';

import './js/storage.js';
import './js/global.js';

const defaultRoute = {
   name: 'Login',
   component: Login,
};
export default class loanBefore extends Component {

  _renderScene(route, navigator) {
    let Component = route.component;
    return (
      <Component {...route.params} navigator={navigator} />
    );
  }


  render() {
    return (
      // <Navigator
      //    initialRoute={defaultRoute}
      //    renderScene={this._renderScene}
      // />

      <Navigator
        initialRoute={defaultRoute}
        //配置场景
        configureScene=
        {
          (route) => {
            //这个是页面之间跳转时候的动画，具体有哪些？可以看这个目录下，有源代码的: node_modules/react-native/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js

            return {...Navigator.SceneConfigs.FloatFromRight, gestures: { pop: false }};
          }
        }
        renderScene={this._renderScene}
      />


    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

AppRegistry.registerComponent('loanBefore', () => loanBefore);
